﻿@model IEnumerable<IndignaFramework.Models.Usuario>

@section featured {
<section class="featured">
    <div class="content-wrapper">
        <hgroup class="title">
            <h1>Mapa de Usuarios</h1>
        </hgroup>
        <p>
            
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCkZuZembP5AbVRO0zEMPWAVW2HYgzicYE&sensor=false">
    </script>
    <script type="text/javascript">
        function initialize() {
                        var myOptions = {
                            center: new google.maps.LatLng(-32.45, -56.48),
                            zoom: 7,
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                        };
                        var map = new google.maps.Map(document.getElementById("map_canvas"),
                        myOptions);
                                        
            
            @for(int i = 0; i < @Model.Count() ; i++){
                
//                <text> 
//                var lat = '@(Model.ElementAt(i).Latitud)';
//                var lng = '@(Model.ElementAt(i).Longitud)';
//                var myLatlng_@i = new google.maps.LatLng(lat.replace(",", "."),lng.replace(",", ".") );
//                var marker_@i = new google.maps.Marker({
//                    position: myLatlng_@i,
//                    map: map
//                });

//                var infowindow = new google.maps.InfoWindow({
//                    content: getWindowInfo('@Model.ElementAt(i).Nombre','@Model.ElementAt(i).Apellido','@Model.ElementAt(i).Residencia')
//                });
//                

//                google.maps.event.addListener(marker_@i, 'click', function() {
//                  infowindow.open(map,marker_@i);
//                });
                
//                </text>
            }
        }

        function getWindowInfo(nombre,apellido,dir){
        
            return '<div>Nombre: '+nombre+' '+apellido+'<br/>'+dir+'</div>';
        }
    </script>
  </head>
  <body onload="initialize()">    

    <div id="map_canvas" style="width:100%; height:600px"></div>
     
  </body>
</html>
        </p>
    </div>
</section>
}